<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>借用构造函数</title>
</head>
<body>
<script src="../js/jquery-3.5.1.js" type="text/javascript"></script>
<script type="text/javascript">
    function Pet(name,health,love) {
        this.name = name;
        this.health = health;
        this.love = love;
    }

    function Dog(name,health,love,strain) {
        Pet.call(this,name,health,love); //调用父类构造函数
        this.strain = strain;
    }

    let dog = new Dog("欧欧",80,100,"拉布拉多");
    console.log(dog);

    let obj = {name:"欧欧",health:100,love:90};  //实际需要的对象属性
    let ouou = {strain:"拉布拉多"}; //继承obj属性

    //继承
    jQuery.extend(ouou,obj);
    console.log(ouou);
</script>

</body>
</html>